import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'
import ComplainFollowUpStatusEnum from '@/feature/cmt/infra/constants/ComplainFollowUpStatusEnum'

export default [
  {
    path: '/cmt',
    component: Layout,
    meta: { title: '店铺违规投诉', icon: 'el-icon-s-help' },
    children: [
      {
        path: 'complain-register',
        component: () => import('@/feature/cmt/app/complain-follow-up/index'),
        meta: { title: '投诉登记', icon: 'table', dataCount: 'complainData.WAIT_SUBMIT' },
        buttons: RouteButtonsBuilder.builder('cmt:complain-follow-up').r({
          exported: true,
          listName: 'list'
        }).view('list').addButtons([
          { handler: 'create', name: 'list', type: TableButtonType.TOOLBAR, label: '投诉登记', icon: 'el-icon-plus' },
          {
            name: 'list',
            handler: 'update',
            type: TableButtonType.ROW,
            label: '修改',
            icon: 'el-icon-edit',
            showFilter: value => value.status < ComplainFollowUpStatusEnum.WAIT_FINISH.id
          },
          {
            handler: 'remove',
            name: 'remove',
            type: TableButtonType.ROW,
            label: '删除',
            buttonType: 'danger',
            icon: 'el-icon-delete'
            // showFilter: value => value.status === ComplainFollowUpStatusEnum.WAIT_SUBMIT.id
          }, {
            handler: 'cancel',
            name: 'cancel',
            type: TableButtonType.ROW,
            label: '作废',
            buttonType: 'danger',
            icon: 'el-icon-delete',
            showFilter: value => value.status < ComplainFollowUpStatusEnum.WAIT_FINISH.id
          }, {
            handler: 'copy',
            name: 'list',
            type: TableButtonType.ROW,
            label: '复制',
            buttonType: 'danger',
            icon: 'el-icon-delete'
          },
          {
            name: 'list',
            handler: 'submitFollow',
            type: TableButtonType.ROW,
            label: '提交',
            buttonType: 'danger',
            showFilter: value => value.status === ComplainFollowUpStatusEnum.WAIT_SUBMIT.id
          }, {
            handler: 'editTbLink',
            name: 'save-tb-link',
            type: TableButtonType.COL,
            col: 'tbLink',
            label: '修改',
            buttonType: 'danger'
          }
          // {name: 'batch-del', type: TableButtonType.TOOLBAR, label: '批量删除', buttonType: 'danger'}
        ])
          .build()
      },
      {
        path: 'complain-follow-up',
        component: () => import('@/feature/cmt/app/complain-follow-up/follow'),
        meta: { title: '投诉跟进', icon: 'table', dataCount: 'complainData.WAIT_FOLLOW' },
        buttons: RouteButtonsBuilder.builder('cmt:complain-follow-up').r({
          exported: false,
          listName: 'follow'
        }).view('follow')
          .addButtons([
            {
              name: 'follow',
              handler: 'follow',
              type: TableButtonType.ROW,
              label: '跟进',
              buttonType: 'danger',
              showFilter: value => value.status === ComplainFollowUpStatusEnum.WAIT_FOLLOW.id
            },
            {
              handler: 'cancel',
              name: 'cancel',
              type: TableButtonType.ROW,
              label: '作废',
              buttonType: 'danger',
              icon: 'el-icon-delete',
              showFilter: value => value.status < ComplainFollowUpStatusEnum.WAIT_FINISH.id
            },
            {
              name: 'follow',
              handler: 'follow',
              type: TableButtonType.ROW,
              label: '继续跟进',
              buttonType: 'danger',
              showFilter: value => value.status === ComplainFollowUpStatusEnum.ING.id
            },
            {
              handler: 'editTbLink',
              name: 'save-tb-link',
              type: TableButtonType.COL,
              col: 'tbLink',
              label: '修改',
              buttonType: 'danger'
            },
            {
              name: 'follow',
              handler: 'reject-follow',
              type: TableButtonType.ROW,
              label: '拒绝跟进',
              buttonType: 'danger',
              showFilter: value => value.status === ComplainFollowUpStatusEnum.WAIT_FOLLOW.id
            }
          ])
          .build()
      },
      // {
      //   path: 'complain-followed',
      //   component: () => import('@/feature/cmt/app/complain-follow-up/my-follow'),
      //   meta: {title: '我的跟进', icon: 'table', dataCount: 'complainData.myFollowCount'},
      //   buttons: RouteButtonsBuilder.builder('cmt:complain-follow-up').r({exported: false, listName: 'follow'})
      //     .addButtons([
      //       {
      //         name: 'follow',
      //         handler: 'follow',
      //         type: TableButtonType.ROW,
      //         label: '继续跟进',
      //         buttonType: 'danger',
      //         showFilter: value => value.status === ComplainFollowUpStatusEnum.ING.id
      //       },
      //       {
      //         handler: 'editTbLink',
      //         name: 'save-tb-link',
      //         type: TableButtonType.COL,
      //         col: 'tbLink',
      //         label: '修改',
      //         buttonType: 'danger'
      //       }
      //     ])
      //     .build()
      // },
      // {
      //   path: 'all-complain-follow-up',
      //   name: 'all-cmt-complain-follow-up',
      //   component: () => import('@/feature/cmt/app/complain-follow-up/all'),
      //   meta: {title: '投诉记录', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('all-cmt-complain-follow-up-check').r({exported: true})
      //     .build()
      // }
      // ,
      // {
      //   path: 'comment-follow-up',
      //   name: 'cmt-comment-follow-up',
      //   component: () => import('@/feature/cmt/app/comment-follow-up/index'),
      //   meta: {title: '评价维护', icon: 'table'},
      //   buttons: RouteButtonsBuilder.builder('cmt-comment-follow-up').curd()
      //     .build()
      // },,
      // {
      //   path: 'complain-follow-up-check',
      //   component: () => import('@/feature/cmt/app/complain-follow-up/auth'),
      //   meta: {title: '投诉审核', icon: 'table', dataCount: 'complainData.WAIT_FINISH'},
      //   buttons: RouteButtonsBuilder.builder('cmt:complain-follow-up:check').r({exported: false}).addCheck(false)
      //     .build()
      // },
      {
        path: 'complain-follow-up-data',
        component: () => import('@/feature/cmt/app/complain-follow-up/data'),
        meta: {
          title: '投诉数据报表',
          icon: 'table'
        },
        buttons: RouteButtonsBuilder.builder('cmt:complain-follow-up:data')
          .r({ exported: false })
          .build()
      }

      // #appendSpot# 生成工具用，不要删了
    ]
  }

]
